home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -websites- / wirenet / files / wirenet151.lzx / Updates / Dashboard < prev    next >
Text File  |  2011-01-31  |  6KB  |  224 lines

  1. /* $VER: Dashboard 1.5 (01.09.96) (c) Neil Bothwick */
  2. /*                                                  */
  3. /* Central interface for Wirenet Internet operation */
  4.  
  5. options results
  6.  
  7. GuiFile = 'AmiTCP:dashboard.gui'
  8. cr = '0a'x
  9. pragma('Directory','AmiTCP:bin')
  10.  
  11. if ~show('L','rexxsupport.library') then
  12.     if ~addlib('rexxsupport.library',0,-30) then exit
  13.  
  14. if ~show('L','rexxdossupport.library') then
  15.     if ~addlib('rexxdossupport.library',0,-30) then exit
  16.  
  17. if ~show('L','rexxreqtools.library') then
  18.     if ~addlib('rexxreqtools.library',0,-30) then exit
  19.  
  20. /* Load Varexx if necessary */
  21.  
  22. if ~show('P','VAREXX') then do
  23.     VarexxStarted = 'Yes'
  24.     address command 'Varexx'
  25.     address command 'WaitForPort VAREXX'
  26.     end
  27.  
  28. address VAREXX
  29.  
  30. call openport('DashPort')
  31.  
  32. 'load' GuiFile 'DashPort'
  33. host = result
  34. address value host
  35.  
  36. /* Set up user-defined buttons */
  37. if exists('AmiTCP:db/User-Button.A') & exists('AmiTCP:db/User-Function.A') then do
  38.     if open(name,'AmiTCP:db/User-Button.A','R') then do
  39.         ButName = readln(name)
  40.         setlabel 'USERA' '"'ButName'"'
  41.         ButtonA = 1
  42.         close(name)
  43.         end
  44.     end
  45. if exists('AmiTCP:db/User-Button.B') & exists('AmiTCP:db/User-Function.B') then do
  46.     if open(name,'AmiTCP:db/User-Button.B','R') then do
  47.         ButName = readln(name)
  48.         setlabel 'USERB' '"'ButName'"'
  49.         ButtonB = 1
  50.         close(name)
  51.         end
  52.     end
  53.  
  54. show 'Dashboard'
  55. call EnableAll(1)
  56.  
  57.  
  58. Busy SET
  59. address command 'StartNet'
  60. Busy
  61.  
  62. do forever
  63.     call waitpkt('DashPort')
  64.     packet = getpkt('DashPort')
  65.     Action = getarg(packet)
  66.  
  67.     select
  68.         when Action = 'CONNECT' then call Connect
  69.         when Action = 'DISCONNECT' then call Disconnect
  70.         when Action = 'GET' then call Get
  71.         when Action = 'BROWSE' then call Browse
  72.         when Action = 'FTP' then call FTP
  73.         when Action = 'WWW' then call WWW
  74.         when Action = 'READ' then call Read
  75.         when Action = 'USERA' then call UserA
  76.         when Action = 'USERB' then call Userb
  77.         when Action = 'EXIT' then call Exit(0)
  78.         when Action = 'QUIT' then call Exit(1)
  79.         when Action = 'CLOSEWINDOW' then call Exit(0)
  80.         when Action = 'TITLE' then call About
  81.         otherwise nop
  82.         end
  83.     end
  84.  
  85. exit
  86.  
  87.  
  88. EnableAll:
  89.     arg flag
  90.     GadList = 'TITLE CONNECT CONNECTTYPE DISCONNECT DISCONNECTTYPE GET GETTYPE WWW FTP BROWSE READ USERA USERB EXIT QUIT'
  91.     if flag = 1 then do
  92.         do i = 1 to words(GadList)
  93.             set word(GadList,i) enable
  94.             end
  95.         if ButtonA ~= 1 then set 'USERA' disable
  96.         if ButtonB ~= 1 then set 'USERB' disable
  97.         end
  98.  
  99.     else
  100.         do i = 1 to words(GadList)
  101.             set word(GadList,i) disable
  102.             end
  103.     return
  104.  
  105. Connect:
  106.     Busy SET
  107.     read CONNECTTYPE
  108.     ConType = result
  109.     address command
  110.     select
  111.         when upper(GetVar('NetState')) = 'ONLINE' then call Request('You are already connected')
  112.         when ConType = 0 then 'Connect'
  113.         when ConType = 1 then 'Connect Mail'
  114.         when ConType = 2 then 'Connect News'
  115.         when ConType = 3 then 'Connect AutoMail'
  116.         when ConType = 4 then 'Connect AutoNews'
  117.         otherwise nop
  118.         end
  119.     address
  120.     Busy
  121.     return
  122.  
  123. Disconnect:
  124.     Busy SET
  125.     read DISCONNECTTYPE
  126.     DisconType = result
  127.     address command
  128.     if DisconType = 0 then 'Connect Off'
  129.     else 'Connect AutoOff'
  130.     address
  131.     Busy
  132.     return
  133.  
  134. FTP:
  135.     Busy SET
  136.     address command 'Run >NIL: AmiTCP:AmiFTP'
  137.     Busy
  138.     return
  139.  
  140. WWW:
  141.     Busy SET
  142.     address command 'Run >NIL: AmiTCP:AWeb/AWeb'
  143.     Busy
  144.     return
  145.  
  146. Get:
  147.     Busy SET
  148.     if exists('ENV:FetchState') then do
  149.         call Request('You are already downloading' GetVar('FetchState')||cr||'Please wait until this has finished before trying again')
  150.         end
  151.     else do
  152.         read GETTYPE
  153.         FetchType = result
  154.         address command
  155.         select
  156.             when FetchType = 0 then 'run >NIL: Fetch Mail'
  157.             when FetchType = 1 then 'run >NIL: Fetch News'
  158.             when FetchType = 2 then 'run >NIL: Fetch All'
  159.             otherwise nop
  160.             end
  161.         address
  162.         end
  163.     Busy
  164.     return
  165.  
  166. Read:
  167.     Busy SET
  168.     address command 'run >NIL: run >nil: `GetEnv THOR/THORPath`Thor System=Wirenet FF'
  169.     Busy
  170.     return
  171.  
  172. Browse:
  173.     if upper(GetVar('NetState')) ~= 'ONLINE' then do
  174.         call Request('You need to be connected'||cr||'     to use this function')
  175.         return
  176.         end
  177.     Busy SET
  178.     address command 'run >NIL: run >nil: `GetEnv THOR/THORPath`ConnectThor'
  179.     Busy
  180.     return
  181.  
  182. UserA:
  183.     Busy SET
  184.     if exists('AmiTCP:db/User-Function.A') then address command 'AmiTCP:db/User-Function.A'
  185.     Busy
  186.     return
  187.  
  188. UserB:
  189.     Busy SET
  190.     if exists('AmiTCP:db/User-Function.B') then address command 'AmiTCP:db/User-Function.B'
  191.     Busy
  192.     return
  193.  
  194. Exit:
  195.     parse arg Quit
  196.     Busy SET
  197.     if Quit = 1 & upper(GetVar('NetState')) = 'ONLINE' then do
  198.         if rtezrequest('This will disconnect you!'||cr||'Are you sure?',' _Yes |_No',,'rtez_defaultresponse=0') = 1 then call Disconnect
  199.         else do
  200.             Busy
  201.             return
  202.             end
  203.         end
  204.     'hide UNLOAD'
  205.     call closeport('DashPort')
  206.     if VarexxStarted = 'Yes' then address command 'SYS:Rexxc/VXC'
  207.     if Quit = 1 then address Command 'StopNet'
  208.     exit
  209.     return
  210.  
  211. About:
  212.     Busy SET
  213.     AboutMsg = 'Wirenet Dashboard (c) Neil Bothwick, 1996'cr|| cr'Created using Varexx by Andy Cook'cr'GadToolsBox by Jan van den Baard'
  214.     if rtezrequest(AboutMsg,' _OK |_Help',,'rt_reqpos=reqpos_centerwin') = 0 then
  215.         address command 'Multiview AmiTCP:doc/Dashboard.guide'
  216.     Busy
  217.     return
  218.  
  219. Request:
  220.     parse arg Message
  221.     call rtezrequest(Message,' _OK ')
  222.     return
  223.  
  224.